﻿package com.findMoneyGame.pages.shop.improvements {
	
	import flash.events.Event;
	import flash.text.TextField;

	import com.findMoneyGame.interfaceComponents.MyButton
	import com.findMoneyGame.models.User;
	import com.findMoneyGame.models.Model;
	
	
	public class BuyImprovementButtonBase extends MyButton {
		
		protected function get price () { return 0; }
		protected function get user () { return User.getInst(); }

		
		public function BuyImprovementButtonBase() {
			user.addEventListener(Model.UPDATE, function (e : Event) { refresh(); });
			refresh();
		}
		private function refresh () {
			var priceLabel = getChildByName('priceLabel') as TextField;
			if (priceLabel != null) {
				priceLabel.text = price.toString();
			}
		}
	}
}
